package cn.edu.nsmc.modules.sys.controller;

import cn.edu.nsmc.common.utils.R;
import cn.edu.nsmc.modules.sys.entity.SysUserEntity;
import cn.edu.nsmc.modules.sys.service.impl.SysStatisticsServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/sys/statistics")
public class SysStatisticsController {
    @Autowired
    private SysStatisticsServiceImpl sysStatisticsService;

    //小程序关注人数统计
    @GetMapping("queryMiniAttention")
    public R queryMiniAttention(Long startTime,Long endTime){
        return sysStatisticsService.queryMiniAttention(startTime,endTime);
    }
    //小程序使用人数统计
    @GetMapping("queryMiniUse")
    public R queryMiniUse(Long startTime,Long endTime){
        return sysStatisticsService.queryMiniUse(startTime,endTime);
    }
    //工单审批统计
    @GetMapping("queryWorksheetAudit")
    public R queryWorksheetAudit(Long startTime,Long endTime){
        return sysStatisticsService.queryWorksheetAudit(startTime,endTime);
    }
    //补充：均可按照指定周期查看并导出excel文件
    @GetMapping("exportMiniAttention")
    public void exportMiniAttention(Long startTime,Long endTime){
        sysStatisticsService.exportMiniAttention(startTime,endTime);
    }
    @GetMapping("exportMiniUse")
    public void exportMiniUse(Long startTime,Long endTime){
        sysStatisticsService.exportMiniUse(startTime,endTime);
    }
    @GetMapping("exportWorksheetAudit")
    public void exportWorksheetAudit(Long startTime,Long endTime){
        sysStatisticsService.exportWorksheetAudit(startTime,endTime);
    }
    //小程序用户数量统计
    @GetMapping("queryUsersQuantity")
    public R queryUsersQuantity(Long startTime,Long endTime, Integer spanType){
        return sysStatisticsService.queryUsersQuantity(startTime,endTime,spanType);
    }
    //工单数据统计
    @GetMapping("queryWorksheetsInfo")
    public R queryWorksheetsInfo(Long startTime,Long endTime,Integer spanType,Integer queryType){
        return sysStatisticsService.queryWorksheetsInfo(startTime,endTime,spanType,queryType);
    }
}
